/**
 * 
package org.spring.boot.fusion.server.filter;

import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR;

import java.net.URI;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.util.UriComponentsBuilder;

import reactor.core.publisher.Mono;

@Component
public class HttpsToHttpFilter implements GlobalFilter, Ordered {

	@Override
	public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
		Object uriObj = exchange.getAttributes().get(GATEWAY_REQUEST_URL_ATTR);
		if (uriObj != null) {
			URI uri = (URI) uriObj;
			uri = this.upgradeConnection(uri, "http");
			exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, uri);
		}
		return chain.filter(exchange);
	}

	private URI upgradeConnection(URI uri, String scheme) {
		UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromUri(uri).scheme(scheme);
		if (uri.getRawQuery() != null) {
			uriComponentsBuilder.replaceQuery(uri.getRawQuery().replace("+", "%20"));
		}
		return uriComponentsBuilder.build(true).toUri();
	}

	@Override
	public int getOrder() {
		return 10101;
	}
}
 */
